/**
* 우선 바닥을 이미지로 깐다.
 * 그 다음 비트맵 소스(읽어들인 부분)을 특정위치에 덧붙인다.
*/
package net.sangpil.applications.project.architecture.Building3DViewerWithFlv
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	
	import net.sangpil.classes.events.SimpleLoaderEvent;
	import net.sangpil.classes.net.SimpleLoader;

	[Event(name = "readyToScale", type = "net.sangpil.applications.project.architecture.Building3DViewerWithFlv.UVmapWithAdditionalBitmapDataEvent")]
	public class UVmapWithAdditionalBitmapData extends Sprite
	{
		public var bitmap:Bitmap;
		
		private var url:String;
		private var simpleLoader:SimpleLoader;
		public function UVmapWithAdditionalBitmapData()
		{
			super();
		}
		
		public function load(url:String):void
		{
			this.url = url;
			
			this.simpleLoader = new SimpleLoader();
			this.simpleLoader.addEventListener(SimpleLoaderEvent.COMPLETED, onLoad);
			this.simpleLoader.load(url);
		}
		
		private function onLoad(e:SimpleLoaderEvent):void
		{
			trace(e.content);
			this.bitmap = e.content as Bitmap;
			this.addChild(this.bitmap);
			this.dispatchEvent(new UVmapWithAdditionalBitmapDataEvent(UVmapWithAdditionalBitmapDataEvent.READY_TO_SCALE));
		}
	}
}